package com.xm.email.core;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * 发送邮件授权
 */
public class MyAuthenticator extends Authenticator{   
    String userName = null;
    String password = null;

    //私有化构造方法
    private MyAuthenticator(){
    }

    public MyAuthenticator(String username, String password) {    
        this.userName = username;    
        this.password = password;    
    }    
    protected PasswordAuthentication getPasswordAuthentication(){   
        return new PasswordAuthentication(userName, password);   
    }   
}   
